import java.util.Scanner;

public class xiecheng {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String src=sc.nextLine();
        String over = "";
        int butong=0;
        for (int i = 0; i <src.length() ; i++) {
            over+=String.valueOf(src.charAt(i)-65);
        }

        for (int i = 0; i < over.length()-1; i++) {
            if(over.charAt(i)!='0'){
                String  linshi = String.valueOf(over.charAt(i))+String.valueOf(over.charAt(i+1));
                if (Integer.parseInt(linshi)>=0&&Integer.parseInt(linshi)<=25){
                    butong++;
                }
            }
        }
        System.out.println(butong);
    }
}
